#include <stdio.h>

#include "sequence.h"

int PrintList(SeqList List);
ElemType Tmp;
SeqList MyList;
int main(int argc,char** argv){
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    InitList(&MyList);
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    ListInsert(&MyList,1,18);
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    ListInsert(&MyList,5,128);
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    PrintList(MyList);

    ListDelete(&MyList,1,&Tmp);
    printf("The %d has been deleted\n",Tmp);


    PrintList(MyList);
    ListInsert(&MyList,8,228);
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    PrintList(MyList);




    ClearList(&MyList);
    printf("IsEmpty:%d\n",ListEmpty(MyList));
    return(0);

}

int PrintList(SeqList List){
    for (int i = 0; i < List.list_length; ++i) {
        printf("%d ",*(List.list_head+i));
    }
    putchar('\n');
    return(0);
}